<?php
/**
 * @Notes:【】
 * @Date: 2022-06-03 16:09
 */

namespace Yj\Generator\Core\Common\Template\Traits;

trait AccessTrait
{
    /**
     * @var string
     */
    protected $access;


    /**
     * @return string
     */
    public function getAccess()
    {
        return $this->access;
    }

    /**
     * @param string $access
     *
     * @return $this
     */
    public function setAccess($access)
    {
        if (!in_array($access, ['private', 'protected', 'public'])) {
            $access = 'public';
        }

        $this->access = $access;

        return $this;
    }
}